//---------------------------------------------------------------------------------
#ifndef __CMAINWINDOW_H__
#define __CMAINWINDOW_H__
//---------------------------------------------------------------------------------
#include <QMainWindow>
#include <QTimer>
#include "ui_CMainWindow.h"
#include "CMap.h"
//---------------------------------------------------------------------------------
class CMainWindow : public QMainWindow, private Ui::MainWindow {
	Q_OBJECT
	public:
		CMainWindow(int curLevel);
	private:
		typedef void (CMainWindow::* pMPFunction)(void);
		
		CMap *map;
		int curLevel;
		QTimer *timer;
		int nbVie;
		int nbDeplacement;
		int nbPush;
		QList<CMap::EAction> nextActions;
		pMPFunction MPFunctions[NB_ACTION];
		
		void updateAffichage(void);
		void loadLevel(void);
		void moveUp(void);
		void moveDown(void);
		void moveRight(void);
		void moveLeft(void);
		void pushUp(void);
		void pushDown(void);
		void pushRight(void);
		void pushLeft(void);
	private slots:
		void onRestart(void);
		void onWin(void);
		void onTimerTimeout(void);
		void onPlayerMove(QList<CMap::EAction> actions);
		void on_pbRecharger_clicked(bool checked=false);
		void on_pbPrev_clicked(bool checked=false);
		void on_pbNext_clicked(bool checked=false);
};
//---------------------------------------------------------------------------------
#endif //__CMAINWINDOW_H__
//---------------------------------------------------------------------------------